<?php

$this->_toolbar = array(
	'title'		=>	Yii::t('admin_news', 'Pages Manager'),
);
?>
<div class="search-form">
<?php $this->renderPartial('_search', array(
	'model' => $model,
)); ?>
</div><!-- search-form -->
<?php 
	Yii::app()->clientScript->registerScript('tooltip2', "jQuery('.button-column a').tooltip();");
	Yii::app()->clientScript->registerScript('tooltip2', "jQuery('a.status_toggle').tooltip();");
?>
<?php
$this->widget('ext.widgets.iGridView', array(
	'id' => 'pages-grid',
	'dataProvider' => $model->search(),
	'afterAjaxUpdate'=>'function(){jQuery(".button-column a").tooltip();jQuery("a.status_toggle").tooltip();}',
	'columns' => array(
		array(
			'name'	=>	'id',
			'htmlOptions'	=>	array(
				'width'	=>	'30',
			),
		),
		array(
			'name'	=>	'page_tree',
			'type'	=>	'raw',
			'value'	=>	'CHtml::link(CHtml::encode($data->page_tree), array("pages/update","id"=>$data->id),array("style"=>"text-decoration:none"))'
		),
		'alias',
		array(
			'name'	=>	'ordering',
			'htmlOptions'	=>	array(
				'width'	=>	'80',
			),
		),
		array(
            'class'=>'JToggleColumn',
            'name'=>'status', // boolean model attribute (tinyint(1) with values 0 or 1)
            'htmlOptions'=>array('width'=>'80'),
        ),
		/*
		'created',
		'created_by',
		'modified',
		'modified_by',
		'ordering',
		'metakey',
		'metadesc',
		array(
					'name' => 'published',
					'value' => '($data->published == 0) ? Yii::t(\'app\', \'No\') : Yii::t(\'app\', \'Yes\')',
					'filter' => array('0' => Yii::t('app', 'No'), '1' => Yii::t('app', 'Yes')),
					),
		*/
		array(
			'class' => 'CButtonColumn',
		),
	),
)); 
?>